﻿using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WorkBasket.Data.Entities
{
    public enum ChildProcessType
    {
        Serial,
        Parallel
    }

    public class Step
    {

        public int StepID { get; set; }
   
        [JsonIgnore]
        public virtual Step ParentStep { get; set; }

        public string StepName { get; set; }
        public string AssignTo { get; set; }
        public int StepOrder { get; set; }
        public int SLA { get; set; }

        public bool IsPublic { get; set; }

        public int WorkbasketFormID { get; set; }

        public string Type { get; set; }
        public string TypeData { get; set; }


        public ChildProcessType ChildProcessType { get;set;}


        public int  ProcessVersionID { get; set; }

        [JsonIgnore]
        public virtual ProcessVersion ProcessVersion { get; set; }

          [JsonIgnore]
        //public virtual ICollection<StepAction> StepActions { get; set; }
        //  [JsonIgnore]
        public virtual ICollection<Step> ChildSteps { get; set; }

        public int?   ParentStepID { get; set; }
    }

    /// <summary>
    /// object used for rendering nodes in jstree
    /// </summary>
    public class TreeNode
    {
        public string id { get; set; }
        public string parent { get; set; }
        public string text { get; set; }

        public string state { get; set; }

        public string type { get; set; }

        public string li_attr { get; set; }
    }


}
